if __name__ == '__main__':
    #定义字符串

    str = "hello word!!!"
    print(len(str))
    for i in range(0,len(str)):
            print(str[i])

    for c in str:
        print(c)


    #切片
    str2=str[0:]
    print(str2)
    str3=str[::-1]
    print(str3)
    str4=str[4:3:-1]
    print(str4)
    #字符串的分割操作
    strList =str.split(" ")
    print(strList)
    #替换操作
    str7=str.replace("!","?")
    print(str7)
    #统计一个字符串出现子串的个数
    print(str.count("l"))
    print(str.count("ll"))
    print(str.count("o"))